package cn.yanxi.controller;

import cn.yanxi.model.User;
import cn.yanxi.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by 言溪 on 2016/11/15.
 */
@Controller
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping(value = "/save_user")
    public String saveUser(@ModelAttribute User user){
        userService.saveUser(user);
        return "login";
    }
}
